package org.dromara.common.core.domain.model;

import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.enums.UserType;
import org.hibernate.validator.constraints.Length;

import static org.dromara.common.core.constant.UserConstants.*;
import static org.dromara.common.core.constant.UserConstants.PASSWORD_MAX_LENGTH;

/**
 * APP密码登录对象
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class AppPasswordLoginBody extends LoginBody {
    /**
     * 用户名
     */
    @NotBlank(message = "{user.username.not.blank}")
    @Length(min = USERNAME_MIN_LENGTH, max = USERNAME_MAX_LENGTH, message = "{user.username.length.valid}")
    private String username;

    /**
     * 用户密码
     */
    @NotBlank(message = "{user.password.not.blank}")
    @Length(min = PASSWORD_MIN_LENGTH, max = PASSWORD_MAX_LENGTH, message = "{user.password.length.valid}")
    private String password;

    /**
     * 用户类型
     */
    private String userType = UserType.APP_USER.getUserType();

    /**
     * 邀请人code
     */
//    @NotBlank(message = "邀请人code不能为空", groups = { AddGroup.class, EditGroup.class })
    private String inviterCode;

    /**
     * 注册设备类型，IOS，Android
     */
//    @NotBlank(message = "注册设备类型，IOS，Android不能为空", groups = { AddGroup.class, EditGroup.class })
    private String registerDeviceType;
}
